import axios from 'axios'
import qs from 'qs'

const BASE_API = "http://161.117.83.241:6060/comp/"

axios.defaults.baseURL = BASE_API
// process.env.NODE_ENV

// 获取启动页
export const getStartup = (params) => {
    return axios.post(`startup/list`, params)
    .then(res => res.data)
}
// 新增启动页
export function addStartup(params) {
    return axios.post('startup/add', params)
    .then(res => res.data)
}

// 删除启动页
export const deleteStartup = params => {
    return axios.post(`startup/delete/${params}`)
    .then(res => res.data)
}

// 编辑启动页
export const editStartup = (params, startupId) => {
    return axios.post(`startup/edit/${startupId}`, params)
    .then(res => res.data)
}
// 上传启动页图片
export const upload = params => {
    return axios.post('startup/upload', params, {headers: {'Content-Type': 'multipart/form-data'}})
    .then(res => res.data)
}